<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>天禾人才</title>
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="minimal-ui=yes,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="msapplication-tap-highlight" content="no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">

	<link rel="stylesheet" type="text/css" href="css/public.css">
	<link rel="stylesheet" type="text/css" href="css/news.css">
	
</head>
<body>
	<div class="header">
		<div class="top">
			<div class="sn-nav-title of">行业动态</div>
		</div>
	</div>
	<div class="container">
<!-- 		<div class="title clearfix">
			<h3 class="fl current" id="title_news">
				<a href="javascript:load({type:'news'});">行业动态</a>
			</h3>
			<h3 class="fl" id="title_notice">
				<a href="javascript:load({type:'notice'});">平台公告</a>
			</h3>
		</div> -->
		<div class="news">
			<ul id="new_list">
			</ul>
		</div>
	</div>
<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript" src="/resources/js/wbkDate.js" ></script>
<script type="text/javascript">

var pageIndex = 0;

load({"type":"news","pageIndex":0});

function load(data){
	$('.fl').removeClass('current');
	if(data.type == "news"){
		$('#title_news').addClass('current');
	}
	if(data.type == "notice"){
		$('#title_notice').addClass('current');
	}
	var defaultParam = {"pageIndex":pageIndex};
	$.ajax({
		url : "/news/selectNewsListByPage",
		data : $.extend(defaultParam,data),
		type : "post",
		dataType : "json",
		success : function(data) {
			var append = "";
			if(data != null){
				var dataarr = data.data;
				if(dataarr != undefined){
					for(i=0;i<dataarr.length;i++){
						
						var date_str="";
						
						var now = new Date(dataarr[i].createTime);
						var year=now.getYear().toString();     
						var month=now.getMonth()+1;     
						var date=now.getDate();     
						
						if(month<10)
						{
							month='0'+month;
						}
						if(date<10)
						{
						 date='0'+date;
						}
						date_str= "20"+year.substr(1,year.length)+"-"+month+"-"+date;
						alert(date_str);
						
					 append+="<a href='newDetail.html#"+dataarr[i].id+"'><li class='clearfix'>"+
						     "<div class='fl'><p>"+dataarr[i].title+"</p>"+
						     "<p class='date'>"+date_str+"</p></div>"+
						     "<div class='fr'><img src='img/you.png'></div></li></a>";
					}
				}else{
					append = append +"<li class='clearfix' style='padding-left:20px'>没有数据</li>";
				}
			}
			$('#new_list').empty().append(append);			
		},
		error : function(jqXHR, textStatus, errorThrown) {
			alert(jqXHR.responseText);
		}
	})
}

</script>	
</body>

</html>